/*
 * @Descripttion: 
 * @Author: ziwei
 * @Date: 2022-08-28 16:15:30
 * @LastEditors: ziwei
 * @LastEditTime: 2022-08-28 16:15:38
 */
self.addEventListener('message', function (e) {
    console.log('service worker receive message', e.data);
    e.waitUntil(
        self.clients.matchAll().then(function (clients) {
            if (!clients || clients.length === 0) {
                return;
            }
            clients.forEach(function (client) {
                client.postMessage(e.data);
            });
        })
    );
});